<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class project_content_comment_model extends MY_model {
	public function __construct() {
		parent::__construct ( 'project_content_comment' );
	}
	/**
	 * 创建数据表
	 */
	public function create() {
		$this->drop ();
		$sql = "CREATE TABLE `project_content_comment` (
				  `pccid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '众创项目id',
				  `pcid` int(10) unsigned NOT NULL COMMENT '众创项目内容id',
				  `uid` int(10) unsigned NOT NULL COMMENT '用户ID',
				  `createtime` int(10) unsigned NOT NULL COMMENT '评论时间',
				  `content` text NOT NULL COMMENT '评论内容',
				  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '众创项目评论状态（0：删除；1：正常）',
				  PRIMARY KEY (`pccid`)
				) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='众创项目内容评论关联表';";
		$re = $this->db->simple_query ( $sql );
		return $re;
	}
	/**
	 * 删除数据表
	 */
	public function drop() {
		$sql = 'DROP TABLE IF EXISTS `project_content_comment`;';
		$re = $this->db->simple_query ( $sql );
		return $re;
	}
}